Ext.define('HGMIDE.controller.LoginController', {
			extend : 'Ext.app.Controller',
			config : {
				refs : {
					loginBtn : '#loginBtn'
				},
				control : {
					loginBtn : {
						tap : 'doLogin'
					}
				}
			},
			doLogin: function () {
				var values = Ext.getCmp('login_panel').getValues();
				if (values.password.trim() == null
						|| values.password.trim() == '') {
					Ext.Msg.show({
					     message: I18N.error_message.developerError.pwd_null,
					     buttons: [
					    	 {text:'确定',itemId:'ok'},
					     ]
					});
					return;
				}
				var developerModel = Ext.create('HGMIDE.model.DeveloperModel');
				Ext.Ajax.request({
							url : 'login',
							method : 'POST',
							params : {
								action : 'login',
								password : values.password.trim()
							},
							success : function(response) {
								var text = response.responseText;
								if ('OK' == text.substring(0,
										text.indexOf(cmdFlag.CMDFlagSeperator))) {
									var json = Ext.JSON
											.decode(text
													.substring(text
															.indexOf(cmdFlag.CMDFlagSeperator)
															+ 1));
									developerModel.set('id', json.id);
									developerModel.set('name', json.name);
									developerModel.set('email', json.email);
									developerModel.set('ca', json.ca);
									developerModel.set("password",values.password.trim());
									Util.currentDeveloper = developerModel;
									Ext.Viewport.add(Ext
											.create('HGMIDE.view.Main'));
									IDE.onload();
									Ext.getCmp('login_panel').hide();
								} else if (text == 'NO') {
									Ext.Msg.show({
									     message: I18N.login_fail,
									     buttons: [
									    	 {text:'确定',itemId:'ok'},
									     ]
									});
								}
							}
						});
			}
		});
